package com.centriole.service.workflow.service.shiro;

import com.centriole.common.entity.ExUser;
import com.centriole.service.workflow.entity.shiro.ShiroUser;
import com.centriole.service.workflow.service.feign.ExUserClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 *
 *  功   能：Mock Service ， ShiroUser
 *  创建人：陈默晗
 *  时   间：2018年1月4日上午10:58:02
 */
@Service
public class IShiroUserService {

	@Autowired
    ExUserClient exUserClient;
	/*
	public static List<Role> roleListByAdmin = Arrays.asList(new Role[]{
			new Role(1L,"管理员",IRoleService.rolePermissionListByAdmin)
	});
	public static List<Role> roleListByNormal = Arrays.asList(new Role[] {
			new Role(1L,"一般用户",IRoleService.rolePermissionListByNormal)
	});
	// public ShiroUser(Integer userId, String account, String password, String userName, String accountStatus, List<Role> roles)
	private static final List<ShiroUser> shiroUserList = Arrays.asList(new ShiroUser[]{
			new ShiroUser(1,"admin","123456","管理员","1",roleListByAdmin),
			new ShiroUser(2,"00001","123456","刘羽","1",roleListByNormal),
			new ShiroUser(3,"00002","123456","刘丹","1",roleListByNormal)
	});
	*/
	public void update(ShiroUser user) {

	}

	public List<ShiroUser> getAll() {
		List<ExUser> exUsers = exUserClient.listAllExUsers();
		return UserShiroConvertor.toShiroUserList(exUsers);
	}

}
